home *** CD-ROM | disk | FTP | other *** search
-
- ***** README file, uubatch version 1.0.5 *****
-
- uubatch : A UUCP rmail batcher/debatcher package.
-
- Authors : Gil Tene (devil@hellnet.org)
- Baruch Cochavy (blue@dduster.hellnet.org)
-
-
- Problem definition and solution approach :
-
- Problem definition : the uubatch package is aimed at increasing UUCP
- e-mail transfer efficiency. The main efficiency drawback in UUCP e-mail
- (via the rmail command) is the small UUCP job sizes. Most mail messages
- tend to be short (less than 5K). Each such message is queued separately
- by UUCP, and is transferred separately by uucico. This make for a very
- high job-count/Kbytes ratio. Each job transfer (two files per job)
- usually takes more than 8 seconds on most links regardless of job
- size. On modems with UUCP spoofing the drawback is even more noticeable,
- as they have a very high UUCP transfer efficiency WITHIN each
- file transferred, but suffer just like any other modem on per-file
- delays. This means that UUCP spoofing efficiency is not really
- utilized on short e-mail transfers.
-
- The solution is simple: reduce the job-count/Kbyte count, thereby
- increasing efficiency. This is done by "batching" several e-mail
- messages together into one UUCP job, thus suffering only one
- per-job delay for each batch.
-
- This solution has been implemented in other packages (Smail 3.1
- compressed batched SMTP mail for one) by having the mailer NOT
- deliver rmail jobs to UUCP immediately, but rather queue them
- separately and batch them together into one large job every once
- in a while. This technique has two major drawbacks: It forces
- the ***mailers*** on both sides to support the protocol, and
- it causes delays in mail delivery (you balance efficiency against
- delivery speed).
-
- The uubatch package provides the solution by batching e-mail
- transfers AFTER they have been queued by UUCP as rmail commands,
- and "debatching" them back on the other side as normal UUCP rmail
- commands.
-
- The uubatch package offers several advantages over other e-mail
- batching schemes :
-
- 1) It is independent of the mailer used. It will work on spooled
- rmail commands, which are the same for all mailers.
-
- 2) It doesn't cause any delay in mail delivery. It batches already
- queued jobs. If it doesn't get a chance to batch a mail message
- before a poll occurs, that message will be transferred as normal
- unbatched rmail.
-
- 3) It does re-batching. This makes sure that batched jobs are used
- to their maximum efficiency. You can run the batching script as
- often as you like without worrying about loosing transfer
- efficiency (it won't make lots of small batches).
-
- 4) The code is SIMPLE, relatively short, easy to understand and to
- port. It will not interfere or clash with mailer configurations.
-
-
- Implementation mechanism :
-
- The mechanism is in two parts :
-
- Sending end: the batcher : uubatch, uucplock (C programs)
-
- The uubatch program is run periodically on [specified] outgoing spool
- directories. In each spool directory uubatch batches together any rmail
- jobs and any previous batches (uudebat or uucdebat jobs) it finds that
- are small enough (execution settable critical size).
-
- The batching is very simple : Once a batchable job is identified, it's
- data file names (both local and final remote names) are parsed. The data
- files are then appended to a "uubatch" file with a simple envelope that
- includes their final remote names and enables simple extraction on the
- other side. In the case of re-batching of batch jobs (uudebat and uucdebat)
- the contents of the job's data file (uncompressed in the case of uucdebat)
- is simply appended to the "uubatch" file. Once all rmail/uudebat/uucdebat
- jobs are batched, or once the "uubatch" data file reaches a given critical
- size, the following command is executed :
-
- uux - -r nodename!uudebat < batchname
-
- (or compress -c | batchname uux - -r nodenanme!uucdebat)
-
- Re-batching of batched jobs is ONLY done if there is at least one rmail
- job in the queue, and only on jobs that are small enough to be re-batched.
- This avoids avoids any unneeded re-batching.
-
- The entire batching process is done while locking the UUCP node
- via a uucp lock mechanism (I hacked this up from the BSD tip uucplock.c
- code, you can hack it if your locking mechanism is non-HDB or non-BSD).
- This makes sure that no double or partial jobs are transmitted.
- The batching process will only batch files which have been modified more
- than a specified time ago, to avoid any possible synchronization clashes
- with any rmail jobs being created at the same time.
-
- Receiving end: the debatcher : uudebat (C program) and uucdebat (script)
-
- The uucdebat script is trivial : "uncompress | uudebat".
-
- uudebat: This VERY simple C program accepts as input a "uubatch" file.
- The file contains destination file names and their file contents
- (each line of the contents is superseded by a # char.). The
- extraction is trivial. It is done into the executing node's
- spool directory (the executing node is figured out from UU_MACHINE).
- This is ALL that needs to be done, since the files will then be
- picked up by uuxqt just as if they were put there by uucico directly.
- The file names and contents are EXACTLY what they were supposed to be,
- and they will all look like normal rmail jobs to uuxqt.
-
- The debatcher program is the one security people would need to look at
- for possible holes, and that is why it is a C program (efficiency is
- another reason). It will ONLY extract files into the connected node's
- incoming spool directory, and it can't be fooled (I believe) into doing
- anything bad by hacking a bogus "uubatch" file and feeding it into
- uudebat.
-
-
- Files:
-
- README -- This file.
-
- Makefile -- A trivial Makefile, it makes the uubatch, uucplock,
- and uudebat executables. Has several defines to
- look at.
-
- uubatch.c -- The job batcher, see mechanism explanation above.
-
- uucplock.c -- A locking mechanism. Based on the BSD tip uucplock.c
- code (and heavily modified for HDB UUCP). See the
- BSD Copyright notice in this file.
-
- uudebat.c -- The job debatcher program, see mechanism explanation
- above.
-
- uucdebat -- A simple shell script for compressed debatching,
- see mechanism explanation above.
-
- uubatch.1 -- man page. (read with : nroff -man uubatch.1 | more)
-
- uudebat.1 -- man page. (read with : nroff -man uudebat.1 | more)
-
-
-
- Installation:
-
- - Unpack the package, decide on where you want to install the uudebat
- and uucdebat commands (they need to be executable by remote via UUCP,
- just like rmail). Check and modify the following parameters in the
- following files :
-
- Makefile : Make sure it will make the files ok. (compiler,
- flags, etc.) Read the description of the defined
- variables and edit their values if needed.
-
- uucdebat : Make sure that the pathnames for uncompress and uudebat
- are correct. It is recommended that you use full path
- names to avoid errors. A mistake here is the only place
- we know of that causes messages to be silently
- bit-bucketed.
-
- uucplock.c : If you have a non-BSD and non-HDB UUCP system, try to
- find out what UUCP locking mechanism is used in your
- system and change this file if needed.
- Make sure PMAX is set to the maximum filename length
- on your system. If the program does not compile as-is
- and you do not find a predefined symbol for this value,
- define PMAX to be 255.
-
- uubatch.c : I don't expect any need to change this file.
-
- uudebat.c : Take a look at the definition of PMAX. It should be
- equal to the maximum length of a path name on your
- system. If the program does not compile as-is, and
- you do not find a predefined symbol for this value,
- define PMAX to be 255.
-
- Make the uubatch, uucplock, and uudebat programs with make(1).
-
- - Install the uudebat and uucdebat commands in a proper location,
- so that they will be able to execute as a remote UUCP command
- (/usr/bin or /bin is the usual place). It is advisable to set the
- owner uid and group of the files to be uucp.
-
- - Make sure that the UUCP permissions file allows remote nodes
- (with which you wish to do uubatch batching) to execute the
- uudebat and uucdebat commands.
-
- - Read the uubatch.1 man page for description of usage and meaning of
- flags in uubatch.
-
- - Run some manual test batches to an adjacent node, manually invoking
- uubatch using syntax like:
-
- uubatch foobar
- or: uubatch -c foobar
-
- (These runs will require supervisor or uucp access rights).
-
- NOTE :
-
- When running tests, and after instalation too, the uubatch and
- uucplock binaries should be located in the same directory. uubatch
- invokes uucplock, and expects it to be runnable with the same
- path prefix it (uubatch) was run with. )
-
- and read the resulting data file created in UUCP spool directory.
- The file should be readable using 'cat {filename}' or 'zcat < {filename}'
- for compressed batches. Once you are satisfied that the batching
- is done right, allow it to go through to the remote node, and verify
- that it has been correctly debatched (It would help if the remote site
- would allow uudebat and uucdebat execution. :-)
-
-
- - Edit uucp's crontab entry, and add an execution of :
-
- /usr/local/uucp/uubatch node [node,...]
-
- (with optional -c for compression, read description of other
- flags in uubatch.1 man page for details on how to control batch
- file sizes)
-
- Set intervals for execution in any way you like. Remember that
- there is no need to open "large" time windows for batching, since
- small jobs will be re-batched. (I use 30 or 60 minute intervals).
-
- Don't redirect the output of uubatch to /dev/nul until you
- have tested it for each node and seen it work. Do some loop mails
- to make sure before running any crucial e-mail through it.
-
-
- Revision history :
-
- 1.0.2 : 01-Aug-1991 First distributed version.
-
- 1.0.3 : 13-Aug-1991 Fixed bugs :
-
- uubatch.c : batching process now correctly calculates
- modifications time and size of job file. time and size
- considerations now handled properly.
-
- uudebat.c : PMAX set to maximum path length on system
- (instead of maximum filename length).
-
- 1.0.4 : uudebat.c : Fixed possible security hole, and added
- better error recovery and security warnings.
-
- uudebat.c : Added filtering of uubatch "escape" lines
- from X. files. This allows uubatch "protocol extensions"
- in future versions, which may be needed to support
- smarter stuff. Upward/Downward compatability will be
- mantained through all future and past versions.
-
- uudebat.c : Removed line length limitation. Any length
- line can now be passed through it.
-
- uubatch.c : Removed line length limitation. Any length
- line can now be passed through it.
-
- uubatch.c : Several performance improvements including :
- - moved directory searchs into uubatch.c
- - allow batching for multiple uucp nodes in one run.
- - removed unneeded 'cat' commands in some places.
-
- uubatch_run : removed this file. All batch execution
- is now performed entirely by uubatch.c, and uubatch.c
- is the program to be called from cron from now on.
-
- uubatch.c and uudebat.c : some readability touch-ups.
-
- Makefile : Touched up a bit and added more tested
- machines.
-
-
- 1.0.5: fix various uncontroled string copies.
- Still in the works: mail bouncing, firewall.
-